<?php

namespace EShop\Controller;

/**
 * MyOrderController 类
 *
 * @since VER:1.0; DATE:2016-9-1; AUTHOR:SoChishun; EMAIL:14507247@qq.com; DESC:Added.
 */
class OrderController extends AppbaseMyController {

    function index() {
        $m_order = new \XWAM\Model\OrderModel();
        $asearch = array(
            'where' => array('buyer_name' => $this->user_login_data['user_name']),
            'search' => array()
        );
        $list = $m_order->get_paging_list($page, array('where' => $asearch['where']), array('page_params' => $asearch['search']));
        $this->assign('list', $list);
        $this->assign('pager', $page->show());
        $this->display('UC/Order/index');
    }

    function order_detail($order_id = 0) {
        if(!is_numeric($order_id)){
            exit('参数无效');
        }
        $m_order = new \XWAM\Model\OrderModel();
        $data = $m_order->find($order_id);
        $list = $m_order->table('t_porg_order_product_list')->where(array('order_id' => $order_id))->select();
        $this->assign('data', $data);
        $this->assign('list', $list);
        $this->display('UC/Order/order_detail');
    }

}
